/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author TANGQUOCTUAN
 */
@Entity
@Table(name = "Restaurants", catalog = "TUNGA", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Restaurants.findAll", query = "SELECT r FROM Restaurants r"),
    @NamedQuery(name = "Restaurants.findByResID", query = "SELECT r FROM Restaurants r WHERE r.resID = :resID"),
    @NamedQuery(name = "Restaurants.findByResName", query = "SELECT r FROM Restaurants r WHERE r.resName = :resName"),
    @NamedQuery(name = "Restaurants.findByAddRes", query = "SELECT r FROM Restaurants r WHERE r.addRes = :addRes"),
    @NamedQuery(name = "Restaurants.findByPhoneRes", query = "SELECT r FROM Restaurants r WHERE r.phoneRes = :phoneRes"),
    @NamedQuery(name = "Restaurants.findByDescription", query = "SELECT r FROM Restaurants r WHERE r.description = :description"),
    @NamedQuery(name = "Restaurants.findByPicture", query = "SELECT r FROM Restaurants r WHERE r.picture = :picture")})
public class Restaurants implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "ResID", nullable = false)
    private Integer resID;
    @Basic(optional = false)
    @Column(name = "ResName", nullable = false, length = 50)
    private String resName;
    @Basic(optional = false)
    @Column(name = "AddRes", nullable = false, length = 50)
    private String addRes;
    @Basic(optional = false)
    @Column(name = "PhoneRes", nullable = false, length = 50)
    private String phoneRes;
    @Basic(optional = false)
    @Column(name = "Description", nullable = false, length = 1000)
    private String description;
    @Column(name = "Picture", length = 1000)
    private String picture;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "restaurants")
    private List<BookRooms> bookRoomsList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "restaurants")
    private List<BookTables> bookTablesList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "restaurants")
    private List<Rooms> roomsList;
    @OneToMany(mappedBy = "restaurants")
    private List<ResTable> resTableList;

    public Restaurants() {
    }

    public Restaurants(Integer resID) {
        this.resID = resID;
    }

    public Restaurants(Integer resID, String resName, String addRes, String phoneRes, String description) {
        this.resID = resID;
        this.resName = resName;
        this.addRes = addRes;
        this.phoneRes = phoneRes;
        this.description = description;
    }

    public Integer getResID() {
        return resID;
    }

    public void setResID(Integer resID) {
        this.resID = resID;
    }

    public String getResName() {
        return resName;
    }

    public void setResName(String resName) {
        this.resName = resName;
    }

    public String getAddRes() {
        return addRes;
    }

    public void setAddRes(String addRes) {
        this.addRes = addRes;
    }

    public String getPhoneRes() {
        return phoneRes;
    }

    public void setPhoneRes(String phoneRes) {
        this.phoneRes = phoneRes;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public List<BookRooms> getBookRoomsList() {
        return bookRoomsList;
    }

    public void setBookRoomsList(List<BookRooms> bookRoomsList) {
        this.bookRoomsList = bookRoomsList;
    }

    public List<BookTables> getBookTablesList() {
        return bookTablesList;
    }

    public void setBookTablesList(List<BookTables> bookTablesList) {
        this.bookTablesList = bookTablesList;
    }

    public List<Rooms> getRoomsList() {
        return roomsList;
    }

    public void setRoomsList(List<Rooms> roomsList) {
        this.roomsList = roomsList;
    }

    public List<ResTable> getResTableList() {
        return resTableList;
    }

    public void setResTableList(List<ResTable> resTableList) {
        this.resTableList = resTableList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (resID != null ? resID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Restaurants)) {
            return false;
        }
        Restaurants other = (Restaurants) object;
        if ((this.resID == null && other.resID != null) || (this.resID != null && !this.resID.equals(other.resID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Restaurants[resID=" + resID + "]";
    }

}
